<?php

/**
 * CategoriaAgua filter form base class.
 *
 * @package    sf_sandbox
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseCategoriaAguaFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'nombre'     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'tipo_valor' => new sfWidgetFormChoice(array('choices' => array('' => '', 'MTS3' => 'MTS3', 'CUOTA' => 'CUOTA'))),
      'valor'      => new sfWidgetFormFilterInput(),
      'interes'    => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'nombre'     => new sfValidatorPass(array('required' => false)),
      'tipo_valor' => new sfValidatorChoice(array('required' => false, 'choices' => array('MTS3' => 'MTS3', 'CUOTA' => 'CUOTA'))),
      'valor'      => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'interes'    => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('categoria_agua_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'CategoriaAgua';
  }

  public function getFields()
  {
    return array(
      'id'         => 'Number',
      'nombre'     => 'Text',
      'tipo_valor' => 'Enum',
      'valor'      => 'Number',
      'interes'    => 'Number',
    );
  }
}
